package util;

import java.awt.Color;
import java.awt.Font;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import javax.swing.table.DefaultTableModel;

public class SwingElement  extends JFrame implements Runnable {
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		
	}
	static String skin[]=new String[]{"Autumn",
        "BusinessBlueSteel",
        "Business",
        "ChallengerDeep",
        "CremeCoffee",
        "DustCoffee",
        "Dust",
        "EmeraldDusk",
        "Magma",
        "MistAqua",
        "MistSilver",
       "Moderate",
        "NebulaBrickWall",
        "Nebula",
        "OfficeBlue2007",
        "OfficeSilver2007",
        "RavenGraphiteGlass",
        "RavenGraphite",
        "Raven",
        "Sahara",
        "Twilight"
	};
	public static JPanel getJP(String name){
		JPanel j1111=new JPanel();//新建一个自己的面板
//		Border b=new LineBorder(Color.black, 1, true);//设置边框的样式
//		j1111.setBorder(BorderFactory.createTitledBorder(b, name, 1, TitledBorder.TOP,new Font("黑体",1,18)));//
		j1111.setBounds(10, 10, 100, 100);//设置自定义面板位置
		
		return j1111;
	}
	public static JLabel getJL(String a){
		JLabel j=new JLabel(a);
		j.setFont(new Font("微软雅黑",1,13));
		return j;
	}
	public static JButton getJB(String a){
		JButton j=new JButton(a);
		j.setFont(new Font("微软雅黑",1,13));
		return j;
	}
public static JTextField getJT(String a,int x,int y,int c,int b){
	JTextField jlb=new JTextField(a);
	jlb.setFont(new Font("微软雅黑",1,12));
	jlb.setBounds(x, y, c, b);
	//jlb.setEditable(false);
	return jlb;
}
public static JTable Table(String[] a,int x,int y,int w,int q){
	
	JTable jj=new JTable();//表格
	jj.setModel(new DefaultTableModel(a,0));
	//int v=width/a.length;
	for(int j=0;j<a.length;j++){
		 jj.getColumnModel().getColumn(j).setMaxWidth(150);//获取模型的列，设置每一列的宽度
		 jj.getColumnModel().getColumn(j).setMinWidth(150);//获取模型的列，设置每一列的宽度
		 }
	return jj;
}
}












